package test07;


/*
 *
 * 还可以使用线程池进行优化,此处省略不写
 *
 * */

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class Sever {
    public static void main(String[] args) throws IOException {
        //建立链接
        ServerSocket serverSocket = new ServerSocket(40000);
        while (true) {
            //等待链接
            Socket socket = serverSocket.accept();
            //创建一个线程
            new Thread(new Myrunable(socket)).start();

        }
    }
}
